<aside class="col-md-4">
    <div class="widget widget-recent-posts">
        <h3 class="widget-title">最新文章</h3>
        <ul>{% for article in recent_articles %}
            <li>
                <a href="{% url 'blog:detail' article.pk %}">{{ article.title }}</a>
            </li>
        {% endfor %}
        </ul>
    </div>

    <div class="widget widget-category">
        <h3 class="widget-title">分类</h3>
        <ul>
            {% for category in category_list %}
                <li>
                    <a href="{% url 'blog:category' category.pk %}">{{ category.name }}</a><span style="float: right">(&nbsp;&nbsp;{{ category.num_articles }}&nbsp;&nbsp;)</span>
                </li>
            {% endfor %}
        </ul>
    </div>

    <div class="widget widget-archives">
        <h3 class="widget-title">归档</h3>
        {% regroup dates by year as dates_by_year %}
        <ul>
            {% for mouth in dates_by_year %}
                <li>
                    <a href="{% url 'blog:archive_year' mouth.grouper %}"> {{ mouth.grouper }} 年</a><i
                        class="{% if forloop.counter0 == 0 %}icon ion-minus{% else %}icon ion-plus{% endif %}"></i>
                    <ul>
                        {% for d in mouth.list %}
                            <li>
                                <a href="{% url 'blog:archive_month_numeric' mouth.grouper d|date:'m' %}">{{ d |date:'n' }}
                                    月
                                </a></li>
                        {% endfor %}
                    </ul>
                </li>
            {% endfor %}

        </ul>
    </div>

    <div class="widget widget-tag">
        <h3 class="widget-title">标签云</h3>
        {% for tag in tag_list %}
            <a href="{% url 'blog:tag' tag.pk %}">{{ tag.name }}&nbsp;&nbsp;(&nbsp;&nbsp;{{ tag.num_articles }}&nbsp;&nbsp;)</a>
        {% endfor %}
    </div>


</aside>